﻿using Eassets.Data.Asset;
using Eassets.Layered.Domain;
using Eassets.Layered.Domain.Asset;
using System.Collections.ObjectModel;

namespace Eassets.Service.Asset
{
    public class AssetRequisitionDetailService
    {
        private AssetRequisitionDetailData assetRequisitionDetaildata = new AssetRequisitionDetailData();

        /// <summary>
        /// Inserts assetRequisitionDetail.
        /// </summary>
        /// <param name="assetRequisitionDetail"></param>
        public void AddAssetRequisitionDetail(AssetRequisitionDetail assetRequisitionDetail)
        {
            if (assetRequisitionDetail != null)
            {
                assetRequisitionDetaildata.AddAssetRequisitionDetail(assetRequisitionDetail);
            }
        }

        /// <summary>
        /// Updates assetRequisitionDetail.
        /// </summary>
        /// <param name="assetRequisitionDetail"></param>
        public void ModifyAssetRequisitionDetail(AssetRequisitionDetail assetRequisitionDetail)
        {
            if (assetRequisitionDetail != null)
            {
                assetRequisitionDetaildata.ModifyAssetRequisitionDetail(assetRequisitionDetail);
            }
        }

        /// <summary>
        /// GetbyId assetRequisitionDetail.
        /// </summary>
        /// <param name="assetRequisitionId"></param>
        public AssetRequisitionDetail GetByIdAssetRequisitionDetail(long assetRequisitionId)
        {
            return assetRequisitionDetaildata.GetByIdAssetRequisitionDetail(assetRequisitionId);
        }

        /// <summary>
        /// GetAll assetRequisitionDetail.
        /// </summary>
        public Collection<AssetRequisitionDetail> GetAllAssetRequisitionDetail()
        {
            return assetRequisitionDetaildata.GetAllAssetRequisitionDetail();
        }

        public long GetAssetIdByAssetCode(string assetCode)
        {
            return assetRequisitionDetaildata.GetAssetIdByAssetCode(assetCode);
        }

        public Collection<Employee> GetEmployeesInAuthorizationGroups()
        {
            return assetRequisitionDetaildata.GetEmployeesInAuthorizationGroups();
        }

        public Collection<AssetRequisitionDetail> GetARNDetailsByTransactionNo(string transactionNo)
        {
            return assetRequisitionDetaildata.GetARNDetailsByTransactionNo(transactionNo);
        }
    }
}
